package org.jeecg.modules.wms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 成品出库单主表
 */
@Data
@TableName("wms_finished_goods_outbound")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "FinishedGoodsOutbound", description = "成品出库单")
public class FinishedGoodsOutbound implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键ID")
    private String id;

    /**
     * 出库单号
     */
    @Excel(name = "出库单号", width = 15)
    @ApiModelProperty(value = "出库单号")
    private String outboundNo;

    /**订单ID*/
    @ApiModelProperty(value = "订单ID")
    private String orderId;

    /**
     * 订单编号
     */
    @Excel(name = "订单编号", width = 15)
    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    /**
     * 客户ID
     */
    @Excel(name = "客户ID", width = 15)
    @ApiModelProperty(value = "客户ID")
    private String customerId;

    /**
     * 客户名称
     */
    @Excel(name = "客户名称", width = 15)
    @ApiModelProperty(value = "客户名称")
    private String customerName;

    /**
     * 项目ID
     */
    @Excel(name = "项目ID", width = 15)
    @ApiModelProperty(value = "项目ID")
    private String projectId;

    /**
     * 项目名称
     */
    @Excel(name = "项目名称", width = 15)
    @ApiModelProperty(value = "项目名称")
    private String projectName;


    /**
     * 出库总数量
     */
    @Excel(name = "出库总数量", width = 15)
    @ApiModelProperty(value = "出库总数量")
    private Integer totalQuantity;

    /**
     * 状态(0:待审核 1:已审核 2:已拒绝 3:已执行 4:已取消)
     */
    @Excel(name = "状态", width = 15, dicCode = "outbound_status")
    @Dict(dicCode = "outbound_status")
    @ApiModelProperty(value = "状态")
    private Integer status;


    /**
     * 申请时间
     */
    @Excel(name = "申请时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "申请时间")
    private Date applyTime;

    /**
     * 审核人ID
     */
    @Excel(name = "审核人ID", width = 15)
    @ApiModelProperty(value = "审核人ID")
    private String auditPersonId;

    /**
     * 审核人姓名
     */
    @Excel(name = "审核人", width = 15)
    @ApiModelProperty(value = "审核人姓名")
    private String auditPersonName;

    /**
     * 审核时间
     */
    @Excel(name = "审核时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "审核时间")
    private Date auditTime;

    /**
     * 审核意见
     */
    @Excel(name = "审核意见", width = 15)
    @ApiModelProperty(value = "审核意见")
    private String auditRemark;

    /**
     * 出库时间
     */
    @Excel(name = "出库时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "出库时间")
    private Date outboundTime;

    /**
     * 备注
     */
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    private String tenantId;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;

    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;

    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;

    /**
     * 订单明细列表（用于接收前端传递的简化明细数据）
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "订单明细列表")
    private List<OrderDetailInfo> orderDetailList;

    /**
     * 订单明细信息DTO
     */
    @Data
    @ApiModel(value = "OrderDetailInfo", description = "订单明细信息")
    public static class OrderDetailInfo implements Serializable {
        
        @ApiModelProperty(value = "订单编号")
        private String orderNo;
        
        @ApiModelProperty(value = "订单明细ID")
        private String orderDetailId;
        
        @ApiModelProperty(value = "计划出库数量")
        private Integer plannedQuantity;
        
        @ApiModelProperty(value = "备注")
        private String remark;
    }
}
